home *** CD-ROM | disk | FTP | other *** search
/ Apple WWDC 1996 / WWDC96_1996 (CD).toast / Technology Materials / MacOS 8 Resources / Developer Tools / Mac OS 8 Interfaces & Libraries / Interfaces / AIncludes / Serial.a < prev    next >
Text File  |  1996-05-01  |  7KB  |  177 lines

  1. ;
  2. ;    File:        Serial.a
  3. ;
  4. ;    Contains:    Asynchronous Serial Driver (.AIn/.AOut/.BIn/.BOut) Interfaces
  5. ;
  6. ;    Version:    Technology:    System 7.5.2
  7. ;                Release:    Universal Interfaces 3.0d3 on Copland DR1
  8. ;
  9. ;    Copyright:    © 1984-1996 by Apple Computer, Inc.  All rights reserved.
  10. ;
  11. ;    Bugs?:        If you find a problem with this file, send the file and version
  12. ;                information (from above) and the problem description to:
  13. ;
  14. ;                    Internet:    apple.bugs@applelink.apple.com
  15. ;                    AppleLink:    APPLE.BUGS
  16. ;
  17. ;
  18.     IF &TYPE('__SERIAL__') = 'UNDEFINED' THEN
  19. __SERIAL__ SET 1
  20.  
  21.     IF &TYPE('__TYPES__') = 'UNDEFINED' THEN
  22.     include 'Types.a'
  23.     ENDIF
  24.  
  25. baud150                            EQU        763
  26. baud300                            EQU        380
  27. baud600                            EQU        189
  28. baud1200                        EQU        94
  29. baud1800                        EQU        62
  30. baud2400                        EQU        46
  31. baud3600                        EQU        30
  32. baud4800                        EQU        22
  33. baud7200                        EQU        14
  34. baud9600                        EQU        10
  35. baud14400                        EQU        6
  36. baud19200                        EQU        4
  37. baud28800                        EQU        2
  38. baud38400                        EQU        1
  39. baud57600                        EQU        0
  40. stop10                            EQU        16384
  41. stop15                            EQU        -32768
  42. stop20                            EQU        -16384
  43. noParity                        EQU        0
  44. oddParity                        EQU        4096
  45. evenParity                        EQU        12288
  46. data5                            EQU        0
  47. data6                            EQU        2048
  48. data7                            EQU        1024
  49. data8                            EQU        3072
  50.  
  51. aData                            EQU        6                    ; channel A data in or out (historical) 
  52. aCtl                            EQU        2                    ; channel A control (historical) 
  53. bData                            EQU        4                    ; channel B data in or out (historical) 
  54. bCtl                            EQU        0                    ; channel B control (historical) 
  55. ctsEvent                        EQU        32                    ; flag for SerShk.errs and SerShk.evts 
  56. breakEvent                        EQU        128                    ; flag for SerShk.errs and SerShk.evts 
  57. xOffWasSent                        EQU        128                    ; flag for SerStaRec.xOffSent 
  58. dtrNegated                        EQU        64                    ; flag for SerStaRec.xOffSent 
  59. ainRefNum                        EQU        -6                    ; serial port A input 
  60. aoutRefNum                        EQU        -7                    ; serial port A output 
  61. binRefNum                        EQU        -8                    ; serial port B input 
  62. boutRefNum                        EQU        -9                    ; serial port B output 
  63. swOverrunErr                    EQU        1                    ; serial driver error masks 
  64. breakErr                        EQU        8                    ; serial driver error masks 
  65. parityErr                        EQU        16                    ; serial driver error masks 
  66. hwOverrunErr                    EQU        32                    ; serial driver error masks 
  67. framingErr                        EQU        64                    ; serial driver error masks 
  68. kOptionClockX1CTS                EQU        64                    ; option bit used with Control code 16 
  69. kOptionPreserveDTR                EQU        128                    ; option bit used with Control code 16 
  70.  
  71. sPortA                            EQU        0
  72. sPortB                            EQU        1
  73. ; typedef SInt8                         SPortSel
  74.  
  75. ;  csCodes for serial driver Control routines 
  76.  
  77. kSERDConfiguration                EQU        8                    ; program port speed, bits/char, parity, and stop bits 
  78. kSERDInputBuffer                EQU        9                    ; set buffer for chars received with no read pending 
  79. kSERDSerHShake                    EQU        10                    ; equivalent to SerHShake, largely obsolete 
  80. kSERDClearBreak                    EQU        11                    ; assert break signal on output 
  81. kSERDSetBreak                    EQU        12                    ; negate break state on output 
  82. kSERDBaudRate                    EQU        13                    ; set explicit baud rate, other settings unchanged 
  83. kSERDHandshake                    EQU        14                    ; superset of 10, honors setting of fDTR 
  84. kSERDClockMIDI                    EQU        15                    ; clock externally on CTS with specified multiplier 
  85. kSERDMiscOptions                EQU        16                    ; select clock source and DTR behavior on close 
  86. kSERDAssertDTR                    EQU        17                    ; assert DTR output 
  87. kSERDNegateDTR                    EQU        18                    ; negate DTR output 
  88. kSERDSetPEChar                    EQU        19                    ; select char to replace chars with invalid parity 
  89. kSERDSetPEAltChar                EQU        20                    ; select char to replace char that replaces chars with invalid parity 
  90. kSERDSetXOffFlag                EQU        21                    ; set XOff output flow control (same as receiving XOff) 
  91. kSERDClearXOffFlag                EQU        22                    ; clear XOff output flow control (same as receiving XOn) 
  92. kSERDSendXOn                    EQU        23                    ; send XOn if input flow control state is XOff 
  93. kSERDSendXOnOut                    EQU        24                    ; send XOn regardless of input flow control state 
  94. kSERDSendXOff                    EQU        25                    ; send XOff if input flow control state is XOn 
  95. kSERDSendXOffOut                EQU        26                    ; send XOff regardless of input flow control state 
  96. kSERDResetChannel                EQU        27                    ; reset serial I/O channel hardware 
  97. kSERD115KBaud                    EQU        115                    ; set 115.2K baud data rate (some driver versions) 
  98. kSERD230KBaud                    EQU        230                    ; set 230.4K baud data rate (some driver versions) 
  99. ;  csCodes for serial driver Status routines 
  100.  
  101. kSERDInputCount                    EQU        2                    ; return characters available (SerGetBuf) 
  102. kSERDStatus                        EQU        8                    ; return characters available (SerStatus) 
  103. kSERDVersion                    EQU        9                    ; return version number in first byte of csParam 
  104. SerShk                    RECORD 0
  105. fXOn                     ds.b    1                ; offset: $0 (0)        ;  XOn flow control enabled flag 
  106. fCTS                     ds.b    1                ; offset: $1 (1)        ;  CTS flow control enabled flag 
  107. xOn                         ds.b    1                ; offset: $2 (2)        ;  XOn character 
  108. xOff                     ds.b    1                ; offset: $3 (3)        ;  XOff character 
  109. errs                     ds.b    1                ; offset: $4 (4)        ;  errors mask bits 
  110. evts                     ds.b    1                ; offset: $5 (5)        ;  event enable mask bits 
  111. fInX                     ds.b    1                ; offset: $6 (6)        ;  Input flow control enabled flag 
  112. fDTR                     ds.b    1                ; offset: $7 (7)        ;  DTR input flow control flag 
  113. sizeof                     EQU *                    ; size:   $8 (8)
  114.                         ENDR
  115. SerStaRec                RECORD 0
  116. cumErrs                     ds.b    1                ; offset: $0 (0)        ;  errors accumulated since last SerStatus() call 
  117. xOffSent                 ds.b    1                ; offset: $1 (1)        ;  input (requested to be) held off by xOffWasSent or dtrNegated 
  118. rdPend                     ds.b    1                ; offset: $2 (2)        ;  incomplete read pending in I/O queue 
  119. wrPend                     ds.b    1                ; offset: $3 (3)        ;  incomplete write pending in I/O queue 
  120. ctsHold                     ds.b    1                ; offset: $4 (4)        ;  transmit disabled by hardware handshaking 
  121. xOffHold                 ds.b    1                ; offset: $5 (5)        ;  transmit disabled by XOn/XOff handshaking 
  122. sizeof                     EQU *                    ; size:   $6 (6)
  123.                         ENDR
  124.     IF FOR_SYSTEM7_ONLY THEN
  125. ;
  126. ; pascal OSErr SerReset(short refNum, short serConfig)
  127. ;
  128.     IF GENERATINGCFM THEN
  129.         IMPORT_CFM_FUNCTION SerReset
  130.     ENDIF
  131.  
  132. ;
  133. ; pascal OSErr SerSetBuf(short refNum, Ptr serBPtr, short serBLen)
  134. ;
  135.     IF GENERATINGCFM THEN
  136.         IMPORT_CFM_FUNCTION SerSetBuf
  137.     ENDIF
  138.  
  139. ;
  140. ; pascal OSErr SerHShake(short refNum, const SerShk *flags)
  141. ;
  142.     IF GENERATINGCFM THEN
  143.         IMPORT_CFM_FUNCTION SerHShake
  144.     ENDIF
  145.  
  146. ;
  147. ; pascal OSErr SerSetBrk(short refNum)
  148. ;
  149.     IF GENERATINGCFM THEN
  150.         IMPORT_CFM_FUNCTION SerSetBrk
  151.     ENDIF
  152.  
  153. ;
  154. ; pascal OSErr SerClrBrk(short refNum)
  155. ;
  156.     IF GENERATINGCFM THEN
  157.         IMPORT_CFM_FUNCTION SerClrBrk
  158.     ENDIF
  159.  
  160. ;
  161. ; pascal OSErr SerGetBuf(short refNum, long *count)
  162. ;
  163.     IF GENERATINGCFM THEN
  164.         IMPORT_CFM_FUNCTION SerGetBuf
  165.     ENDIF
  166.  
  167. ;
  168. ; pascal OSErr SerStatus(short refNum, SerStaRec *serSta)
  169. ;
  170.     IF GENERATINGCFM THEN
  171.         IMPORT_CFM_FUNCTION SerStatus
  172.     ENDIF
  173.  
  174.     ENDIF
  175.     ENDIF ; __SERIAL__ 
  176.  
  177.